#ifndef ResultModel_H
#define ResultModel_H

#include <QtGui>
#include "ModelItems/TreeItem.h"
#include "..\core\src\AssetManager.h"

namespace Xps
{
	class ResultModel : public QAbstractItemModel
	{
		Q_OBJECT
		
		int rowcount;
		int colcount;
		QList<int> rowids;
		QList<int> colids;
		XpsAssets::AssetManager* am;

	public:
		enum Role
		{
			VALUE = Qt::UserRole+1,
			TOLERANCE,
			MATCHMODE
		};

		ResultModel(XpsAssets::AssetManager* am);

		bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); 
		QVariant data(const QModelIndex & index, int role ) const;
		Qt::ItemFlags flags(const QModelIndex & index) const;
		int rowCount(const QModelIndex &parent) const;
		int columnCount(const QModelIndex &parent) const;
		QModelIndex parent(const QModelIndex & index) const;
		QModelIndex index(int row, int column, const QModelIndex &parent) const;
		QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
		void clear();

	public slots:
		void addResult(int id);
		void remResult(int id);
		void addAttribute(int id);
		void remAttribute(int id);
	};
}
#endif